const { sequelize, DataTypes } = require('../utils/database');

// 定义用户数据模型
const UserModel = sequelize.define(
  'UserModel',
  {
    user_id: {
      type: DataTypes.INTEGER,
      primaryKey: true,
      autoIncrement: true
    },
    user_name: DataTypes.STRING(20),
    user_pwd: { type: DataTypes.STRING, allowNull: false },
    user_phone: DataTypes.STRING(20),
    user_email: DataTypes.STRING(50),
    user_qq: DataTypes.STRING(20),
    user_sex: DataTypes.STRING(10),
    user_intro: DataTypes.STRING,
    is_active: {
      type: DataTypes.INTEGER,
      allowNull: false,
      defaultValue: 1
    },
    create_time: { type: DataTypes.DATE, allowNull: false },
    update_time: { type: DataTypes.DATE, allowNull: false }
  },
  {
    tableName: 'sp_user',
    timestamps: false
  }
);

module.exports = UserModel;
